package util;

import java.io.InputStream;
import java.util.Properties;

/**
 * Created by zhangjinxia on 2017/10/13.
 */
public class PropertyUtil {
    private static Properties properties;

    static {
        try {
            InputStream inStream = PropertyUtil.class.getClassLoader()
                    .getResourceAsStream("canal-client.properties");
            properties = new Properties();
            properties.load(inStream);
            // 读取得到班级的接口连接信息
        } catch (Exception ex) {
            ex.printStackTrace();
        }

    }

    public static String getValue(String key) {
        return properties.getProperty(key);
    };

    public static Properties getPropertiesSrc() {
        return properties;
    }

    public static void main(String[] args){
        System.out.println(getValue("canal.zkServers"));
    }
}
